using UnityEngine;
using System.Collections;

public class _Barrier2 : MonoBehaviour {

	void Update () 
	{
		if(transform.position.x < -20)
		{
			Destroy (gameObject);
		}
	
	}
	
	void OnCollisionEnter (Collision c)
	{
		if(c.gameObject.CompareTag("Player"))
		{
			Application.LoadLevel("SelecaoCenas");
		}
	}
	
	void OnCollisionStay(Collision c)
	{
		if(c.gameObject.CompareTag("Player"))
		{
			Application.LoadLevel("SelecaoCenas");
		}
	}
}
